home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Topik / Topik - Disk 16 - KnowAboutIt (19xx)(Topik Public Domain)(PD)[WB].zip / Topik - Disk 16 - KnowAboutIt (19xx)(Topik Public Domain)(PD)[WB].adf / MicroRayDbw / ReadMe < prev    next >
Text File  |  1989-10-01  |  9KB  |  236 lines

  1.  
  2. *** TOPIK Note : Everything you need and more if you're interested in
  3. digging deep into the world of raytracing, or if you have been digging for a
  4. while and want to find the treasure. Its all here, but remember
  5. experimentation is the mother of success.
  6.  - Note that all the C source files are here also.
  7.  
  8.  
  9.  
  10. /************************************************************************
  11.  *                           *
  12.  *          Copyright (c) 1988, David B. Wecker         *
  13.  *             All Rights Reserved            *
  14.  *                           *
  15.  * This file is part of DBW_uRAY               *
  16.  *                           *
  17.  * DBW_uRAY is distributed in the hope that it will be useful, but   *
  18.  * WITHOUT ANY WARRANTY. No author or distributor accepts      *
  19.  * responsibility to anyone for the consequences of using it or for   *
  20.  * whether it serves any particular purpose or works at all, unless   *
  21.  * he says so in writing. Refer to the DBW_uRAY General Public      *
  22.  * License for full details.                  *
  23.  *                           *
  24.  * Everyone is granted permission to copy, modify and redistribute   *
  25.  * DBW_uRAY, but only under the conditions described in the      *
  26.  * DBW_uRAY General Public License. A copy of this license is      *
  27.  * supposed to have been given to you along with DBW_uRAY so you   *
  28.  * can know your rights and responsibilities. It should be in a file   *
  29.  * named COPYING. Among other things, the copyright notice and this   *
  30.  * notice must be preserved on all copies.            *
  31.  ************************************************************************
  32.  *                           *
  33.  * Authors:                        *
  34.  *   DBW - David B. Wecker                  *
  35.  *                           *
  36.  * Versions:                        *
  37.  *   V1.0 881023 DBW   - First released version         *
  38.  *   V1.1 881110 DBW - Fixed scan coherence code         *
  39.  *   V1.2 881125 DBW - Removed ALL scan coherence code (useless)   *
  40.  *           added "fat" extent boxes         *
  41.  *                           *
  42.  ************************************************************************/
  43.  
  44. DBW_uRAY (micro raytracer) is a small raytracer developed for my own test
  45. purposes and made available to anyone who wishes to play with ray tracing
  46. algorithms. It runs on several different machines in many different
  47. configurations. It has been tested on:
  48.  
  49.    Amiga 68000/68010/68020 with/without 68881 (using Manx 3.6 compiler)
  50.    Vax   Ultrix and VMS
  51.  
  52. Its features are:
  53.  
  54.     -   VERY good ray tracing algorithm
  55.     -   Automatic oct-tree extent generation for FAST ray tracing
  56.     -   Simple input file format
  57.     -   SMALL easy to read code
  58.     -   very portable
  59.     -   built in advanced features like waves and textures
  60.     -   generates .ILBM files directly
  61.     -   generates .TMP files (compatable with DBW_RENDER v2.0)
  62.     -   easy to extend
  63.     -   progammable aspect ratio and angle of view
  64.     -   single or double precision floating point
  65.     -   automatic (no overhead) sky and ground generation
  66.     -   dithered .ILBM file for much more accurate color reproduction
  67.     -   can generate 24 bit .TMP files ( 16 million colors )
  68.     -   can generate pictures upto 1024 x 1024
  69.  
  70. =================
  71. INPUT FILE FORMAT
  72. =================
  73.  
  74. See URAY.DAT for a sample input file. The options are:
  75.  
  76.     DEPTH   - Maximum recursion depth
  77.     COLS    - columns in the picture
  78.     ROWS    - rows in the picture
  79.     START   - row to start raytracing at
  80.     END       - row to end with
  81.     BPP       - Bits/Pixel in the .tmp file (24,12 or 0 (== no .tmp file wanted))
  82.     AOV       - angle of view (in degrees) <<<<YOUR EYE IS ALWAYS AT 0,0,0>>>>   
  83.     ASPECT  - aspect ratio (For Amiga use .544)
  84.     NEAR    - ambient (background color for "sky" near the eye)
  85.     FAR       - ambient (background color for "sky" far from the eye (horizon))
  86.     GROUND  - ambient (background color below the horizon (y < 0))
  87.     BASE    - minimum diffuse lighting for any object (blackness of shadows)
  88.  
  89. The background is made up of three colors:
  90.  
  91.     NEAR    - the sky overhead
  92.     FAR       - the sky at the horizon
  93.     GROUND  - the ground color
  94.  
  95. Wave sources are listed with a "WAVES" statement. Parameters are:
  96.  
  97.     WAVES n   - n is the number of lines that follow. Each line has 6 numbers:
  98.    x y z   - center of the wave
  99.    amp   - initial amplitude of the wave
  100.    phase   - initial phase shift
  101.    length   - wavelength
  102.    damp   - damping from wave to wave
  103.  
  104. Attributes are listed with an "ATTRIBUTES" statement. Parameters are:
  105.  
  106.     ATTRIBUTES n    - n is the number of lines containing:
  107.    r g b   - base diffuse color
  108.    Kd   - amount of diffuse coloring
  109.    Ks   - specular factor (reflection)
  110.    Kt   - transmission factor (transparency)
  111.    Ir   - index of refraction (for Kt) 1.0 = none
  112.    Kl   - self lighting factor (light source)
  113.    dist   - inverse square law distance (0 = no inv sq law)
  114.    Kf   - fuzz factor (0 = none 1 = max)
  115.    Wave   - wave number (starts at 0) or -1 = no waves -2 = all waves
  116.    tex   - texture:
  117.        0          - none
  118.        1 r g b x y z   - checker in color (r g b) at scale (x y z)
  119.        2 r g b       - random mottled (alternate color = r g b)
  120.        3 r g b a b c   - X axis blend (alt = r g b, X range= a - b - c)
  121.        4 r g b a b c   - Y axis blend (alt = r g b, Y range= a - b - c)
  122.        5 r g b a b c   - Z axis blend (alt = r g b, Z range= a - b - c)
  123.  
  124. Note: When refering to waves or attributes the first one defined is number 0
  125.       the next is number 1 and so forth.
  126.  
  127. Finally objects:
  128.  
  129.     SPHERE a x y z r      - Do a sphere with attribute a (>= 0)
  130.               Center at (x y z) with radius r
  131.     QUAD a x y z i j k l m n   - Do a rectangle with attribute a (>= 0)
  132.               Corners at (x y z), (x+i y+j z+k), and
  133.                 (x+l y+m z+n)
  134.     TRIANGLE a x y z i j k l m n- Do a triangle with attribute a (>= 0)
  135.               Corners at (x y z), (x+i y+j z+k), and
  136.                 (x+l y+m z+n)
  137.     RING a x y z i j k l m n b c- Do a ring with attribute a (>= 0)
  138.               Corners at (x y z), (x+i y+j z+k), and
  139.                 (x+l y+m z+n) inner radius b and outer
  140.                 radius c
  141.  
  142. ===================
  143. RUNNING THE PROGRAM
  144. ===================
  145.  
  146. If you have an input file called input.dat then just type:
  147.  
  148.    uray input
  149.  
  150. and the program will run giving output like the following:
  151.  
  152.     uRAY v1.2 881125 (C) 1988 D. Wecker - all rights reserved
  153.     Creating objects
  154.  
  155.    Input file name:          input
  156.    Maximum recursion depth:     20
  157.    Dimensions:                 200 rows (0,200)  160 columns
  158.    Bits/Pixel:                  24
  159.    Angle of view:               60 degrees
  160.    Aspect ratio:             0.544
  161.    Number of attributes:         6
  162.    Number of waves:              1
  163.  
  164.     Creating object extents
  165.     Creating extent tree
  166.     Using 2 extents for 2 objects
  167.  
  168.  
  169.     Extent setup time:         0.17
  170.  
  171.     Row    0: ..................................................
  172.     Row   50: ..................................................
  173.     Row  100: ..................................................
  174.     Row  150: .................................................
  175.  
  176.  
  177.     Total  run   time:       115.40
  178.  
  179.     False hits: Extents =      60215, Nodes =       5077
  180.     Good  hits: Extents =       6829, Nodes =       1752
  181.     Total hits: Extents =      67044, Nodes =       6829
  182.  
  183. To display the file on the Amiga, just say:
  184.  
  185.     display input
  186.  
  187. Type a <CR> to exit the display.
  188.  
  189. =====
  190. FILES
  191. =====
  192.  
  193.     README       - This file
  194.     COPYING       - License agreement
  195.     Makefile       - rebuild control (see later section)
  196.     Make.version    - retitle source files
  197.  
  198.     display.c       - ILBM display program for the Amiga
  199.  
  200.     extent.c       - automatic oct-tree extent generator
  201.     intersect.c       - ray intersection calculations
  202.     output.c       - output file generation (.ILBM and .TMP)
  203.     random.c       - random number generator
  204.     rkm.c       - RKM compression routines (for .ILBM files)
  205.     support.c       - file input and support routines
  206.     texture.c       - texture calculations
  207.     trace.c       - actual ray tracing code
  208.     uray.c       - main module
  209.     uray.h       - global definitions
  210.     uray.dat       - sample input file
  211.  
  212.     uray.ux       - compiled Ultrix version
  213.     uray.sp       - compiled Amiga single precision version
  214.     uray.dp       - compiled Amiga double precision version
  215.     uray.81       - compiled Amiga double precision 68881 version
  216.     uray.2s       - compiled Amiga 68020/single precision version
  217.     uray.2d       - compiled Amiga 68020/double precision version
  218.     uray.21       - compiled Amiga 68020/68881 double precision version
  219.     display       - compiled Amiga display program
  220.  
  221. Rename the "uray.??" file that you wish to use to "uray".
  222.  
  223. ========
  224. MAKEFILE
  225. ========
  226.  
  227. For the Amiga, uncomment the appropriate definitins of FFLG, DBL and MLIB for
  228. the type of processor/coprocessor and precision you want. Also uncomment the
  229. "Standard flags" for the type of machine that you're on. Then:
  230.  
  231.     make uray display
  232.  
  233. will re-make the ray-tracer and the display programs. See the Makefile for
  234. further details.
  235.  
  236.